<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>密码找回</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../../static/struct/layui256/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../../static/struct/layuimini/css/public.css" media="all">
    <link rel="stylesheet" href="../../../../static/struct/weui/weui.css " media="all">
    <script src="../../../../static/js/login/jquery.min.js" charset="UTF-8"></script>

    <script type="text/javascript">
        function changeBtnable() {
                if ($('#usercode').val()) {
                    $('#sendmail').removeClass('layui-btn-disabled');
                } else {
                    $('#sendmail').addClass('layui-btn-disabled');
                }
        }
    </script>
    <script src="../../../../static/struct/layui256/layui.js" charset="utf-8"></script>
    <script type="text/javascript">
        layui.use(['form', 'table','layer','laydate'], function () {
            var $ = layui.jquery,
                form = layui.form,
                table = layui.table,
                util = layui.util,
                layer = layui.layer,
                laydate = layui.laydate;

            $(document).ready(function () {
                $('#sendmail').click(function () {
                    var data = $('#usercode').val();
                    $.ajax({
                        type: "post",
                        url: "/action/resetPwd",
                        data: JSON.stringify(data),
                        contentType: "application/json;charset=utf-8",
                        dataType: "json",
                        success: function (res) {
                            console.log('res');
                            console.log(res);
                            layer.alert(res.status);
                            $('#sendmail').addClass('layui-btn-disabled');

                        }, error: function (error) {
                            console.log('error');
                            console.log(error);
                            alert(error.responseText);
                        }
                    });
                });
            });
        });
    </script>

</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <fieldset class="table-search-fieldset">
        <form class="layui-form layui-form-pane" action="">

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>Lims Mobile</legend>
            </fieldset>


            <div class="layui-form-item">
                <input type="text" name="psncode" id="usercode" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input" oninput="changeBtnable()">
                <div class="layui-inline">

                    <!--
                    <label class="layui-form-label" > </label>
                    <div class="layui-input-inline">
                        <input type="text" name="psncode" id="usercode"  autocomplete="off" class="layui-input" required  placeholder="请输入用户名（工号）" >
                    </div>
                    -->
                </div>

                <button type="button" id="sendmail" class="layui-btn layui-btn-fluid layui-btn-disabled " >发送验证邮件</button>


                <div class="weui-footer weui-footer_fixed-bottom">
                    <p class="weui-footer__links">
                        <a href="javascript:home();" class="weui-footer__link">Lims Mobile</a>
                    </p>
                    <p class="weui-footer__text">Copyright &copy; 2019-2020 besbing.cn</p>
                </div>
            </div>

        </form>

        </fieldset>
    </div>
</div>
</body>




</html>